package com.zfzs.post.modules.agent.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @author ck
* @date 2019-11-27
*/
@Entity
@Data
@Table(name="policy_divided")
public class PolicyDivided implements Serializable {

    @Id
    @Column(name = "id")
    private Long id;

    // 所属代理商id
    @Column(name = "agent_id")
    private Long agentId;

    // 终端id
    @Column(name = "terminal_id")
    private Long terminalId;

    // 渠道id
    @Column(name = "channel_id")
    private Long channelId;

    @Column(name = "amount")
    private BigDecimal amount;

    // 录入时间
    @Column(name = "create_time")
    private Timestamp createTime;

    @Column(name = "names")
    private String names;

    public void copy(PolicyDivided source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}